how to create a chess game in javascript